Optimal. Leaf size=31 \[ \frac{\cot (x)}{\sqrt{a \csc ^2(x)}}-\frac{\csc (x) \tanh ^{-1}(\cos (x))}{\sqrt{a \csc ^2(x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0997412, antiderivative size = 31, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.294, Rules used = {3657, 4125, 2592, 321, 206} \[ \frac{\cot (x)}{\sqrt{a \csc ^2(x)}}-\frac{\csc (x) \tanh ^{-1}(\cos (x))}{\sqrt{a \csc ^2(x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3657
Rule 4125
Rule 2592
Rule 321
Rule 206
Rubi steps
\begin{align*} \int \frac{\cot ^2(x)}{\sqrt{a+a \cot ^2(x)}} \, dx &=\int \frac{\cot ^2(x)}{\sqrt{a \csc ^2(x)}} \, dx\\ &=\frac{\csc (x) \int \cos (x) \cot (x) \, dx}{\sqrt{a \csc ^2(x)}}\\ &=-\frac{\csc (x) \operatorname{Subst}\left (\int \frac{x^2}{1-x^2} \, dx,x,\cos (x)\right )}{\sqrt{a \csc ^2(x)}}\\ &=\frac{\cot (x)}{\sqrt{a \csc ^2(x)}}-\frac{\csc (x) \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\cos (x)\right )}{\sqrt{a \csc ^2(x)}}\\ &=\frac{\cot (x)}{\sqrt{a \csc ^2(x)}}-\frac{\tanh ^{-1}(\cos (x)) \csc (x)}{\sqrt{a \csc ^2(x)}}\\ \end{align*}
Mathematica [A] time = 0.0318006, size = 32, normalized size = 1.03 \[ \frac{\csc (x) \left (\cos (x)+\log \left (\sin \left (\frac{x}{2}\right )\right )-\log \left (\cos \left (\frac{x}{2}\right )\right )\right )}{\sqrt{a \csc ^2(x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.028, size = 38, normalized size = 1.2 \begin{align*} -{\ln \left ( \sqrt{a}\cot \left ( x \right ) +\sqrt{a+a \left ( \cot \left ( x \right ) \right ) ^{2}} \right ){\frac{1}{\sqrt{a}}}}+{\cot \left ( x \right ){\frac{1}{\sqrt{a+a \left ( \cot \left ( x \right ) \right ) ^{2}}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.70143, size = 36, normalized size = 1.16 \begin{align*} -\frac{\sqrt{-a}{\left (\arctan \left (\sin \left (x\right ), \cos \left (x\right ) + 1\right ) - \arctan \left (\sin \left (x\right ), \cos \left (x\right ) - 1\right )\right )}}{a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.65263, size = 205, normalized size = 6.61 \begin{align*} \frac{\sqrt{2} \sqrt{-\frac{a}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right ) + \sqrt{a} \log \left (\frac{2 \, \sqrt{2} \sqrt{a} \sqrt{-\frac{a}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right ) - a \cos \left (2 \, x\right ) - 3 \, a}{\cos \left (2 \, x\right ) - 1}\right )}{2 \, a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cot ^{2}{\left (x \right )}}{\sqrt{a \left (\cot ^{2}{\left (x \right )} + 1\right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.27008, size = 73, normalized size = 2.35 \begin{align*} \frac{\frac{\log \left (\tan \left (\frac{1}{2} \, x\right )^{2}\right )}{\mathrm{sgn}\left (\tan \left (\frac{1}{2} \, x\right )^{3} + \tan \left (\frac{1}{2} \, x\right )\right )} + \frac{4}{{\left (\tan \left (\frac{1}{2} \, x\right )^{2} + 1\right )} \mathrm{sgn}\left (\tan \left (\frac{1}{2} \, x\right )^{3} + \tan \left (\frac{1}{2} \, x\right )\right )}}{2 \, \sqrt{a}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]